package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {

    /**
     * 根据openid查询
     *
     * @param openid
     * @return {@link User}
     */
    @Select("select id, openid, name, phone, sex, id_number, avatar, create_time from user where openid = #{openid}")
    User selectByOpenid(String openid);

    /**
     * 新增user表
     *
     * @param user
     */
    void insert(User user);

    /**
     * 根据时间从查找用户
     *
     * @param map
     * @return {@link Integer}
     */
    Integer selectCountByTime(Map map);
}
